package enums

import "github.com/gogf/gf/v2/errors/gcode"

/*
错误提示码管理
*/
type OpenResponseEnum struct {
	code    int
	message string
}

func (c OpenResponseEnum) Code() int {
	return c.code
}

func (c OpenResponseEnum) Message() string {
	return c.message
}

func (c OpenResponseEnum) Detail() interface{} {
	return nil
}

var (
	Success             = New(0, "SUCCESS")
	Fail                = New(10000, "系统错误，请联系管理员")
	MethodReqLimitError = New(20000, "请求频繁，请稍后重试")
)

func New(code int, message string) gcode.Code {
	return OpenResponseEnum{code: code, message: message}
}
